
sda = 3
scl = 4
function init_OLED(sda,scl)
     sla = 0x3c
     i2c.setup(0, sda, scl, i2c.SLOW)
     disp=u8g.ssd1306_128x64_i2c(sla)
     disp:setFont(u8g.font_6x10)
     disp:setFontRefHeightExtendedText()
     disp:setDefaultForegroundColor()
     disp:setFontPosTop()
end
function print_OLED()
    disp:firstPage()
    repeat
     disp:drawFrame(2, 2,126,62)
     disp:drawStr(30, 5, "Hello Mcu!!")
     disp:drawStr(30, 20,"CSDNzwh")
     disp:drawStr(80, 40, str1)
     disp:drawFrame(0, 16,128,45)
     disp:drawXBM(10,10,16,16,str4)
     disp:drawXBM(27,10,16,16,cross_bits)
     disp:drawXBM(27+17,10,16,16,str5)
    -- disp:drawXBM(30,30,32,16,cross_bits)
     until disp:nextPage() == false
end
str1="by:zwh"
init_OLED(sda,scl)
str1 = "hello world"
str2 = "nimabi"
str3 = "woyaoshuijiao"
str4 = string.char(0x10,0x01,0x10,0x01,0x10,0x01,0x88,0x7F,0x88,0x40,0x4C,0x20,0x2C,0x04,0x0A,0x04,0x89,0x14,0x88,0x24,0x48,0x24,0x48,0x44,0x28,0x44,0x08,0x04,0x08,0x05,0x08,0x02)
cross_bits = string.char(
0x80,0x00,0x00,0x01,0xFC,0x7F,0x44,0x08,0x44,0x08,0x44,0x08,0xFC,0x7D,0x44,0x08,0x64,0x08,0xE4,0x1C,0x54,0x2D,0x54,0x2A,0x4A,0x49,0x42,0x08,0x41,0x08,0x40,0x08)
str5 = string.char(0x00,0x01,0x00,0x02,0xF8,0x7F,0x08,0x00,0xC9,0x1F,0x4A,0x12,0xCA,0x1F,0x48,0x12,0xCC,0x1F,0x0A,0x00,0xF9,0x7F,0x88,0x08,0x84,0x08,0x84,0x08,0x42,0x08,0x21,0x08)
 print_OLED()

